﻿@model Sundry.Model.UploadSet
@{
    ViewBag.Title = "上传设置";
}

<div class="main-content">
    @RenderPage("~/Areas/Admin/Views/Shared/_AdminContentTop.cshtml", new { PageUrl = "/Admin/SundrySet/UploadSet", PageName = "上传设置", ActiveName = "上传设置" })
    <div class="page-content">
        <!-- /.page-header -->
        <div class="row">
            <div class="col-xs-12 form-horizontal">
                <!-- PAGE CONTENT BEGINS -->
                @using (Html.BeginForm())
                {
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">允许上传图片类型:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.UploadImgType, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="如果有多个值用‘ ,’分割" title="格式说明">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.UploadImgType)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">允许上传图片最大值:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.UploadImgSize, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="单位字节，1KB=1024字节">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.UploadImgSize)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">上传图片水印类型:</label>
                        <div class="col-sm-9">
                            @Html.DropDownListFor(m => m.WatermarkType, Sundry.App_Start.Common.SelectItemHelper.WatermarkType(Model.WatermarkType), new { @class = "col-xs-12 col-sm-6" })
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">上传图片水印质量:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.WatermarkQuality, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="数字越大质量越好">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.WatermarkQuality)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">上传图片水印位置:</label>
                        <div class="col-sm-9">
                            @Html.DropDownListFor(m => m.WatermarkPosition, Sundry.App_Start.Common.SelectItemHelper.WatermarkPosition(Model.WatermarkPosition), new { @class = "col-xs-12 col-sm-6" })
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">上传图片水印图片路径:</label>
                        <div class="col-sm-9">
                            <div class="upload">
                                @if (string.IsNullOrEmpty(Model.WatermarkImg))
                                {
                                    <div class="uploadPreview" style="background: no-repeat;background-size:100% 100%;" id="UploadImageUrl">
                                        暂无图片
                                    </div>
                                }
                                else
                                {
                                    <div class="uploadPreview" style="background: url(@Sundry.App_Start.Common.PubliFunction.ExistsImg(Model.WatermarkImg)) no-repeat;background-size:100" id="UploadImageUrl">
                                    </div>
                                }
                                <div id="ImgUp-queue" class="uploadify-queue"></div>
                                <div class="uploadBut">
                                    <input type="file" name="ImgUp" id="ImgUp" />
                                </div>
                                <input type="hidden" name="WatermarkImg" id="WatermarkImg" value="@Model.WatermarkImg" />
                                <div style="position: absolute; top: 30px; left: 180px;"></div>
                            </div>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.WatermarkImg)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">上传图片水印透明度:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.WatermarkImgOpacity, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="0-100之间">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.WatermarkImgOpacity)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">上传图片水印文字:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.WatermarkText, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.WatermarkText)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">上传图片水印文字字体:</label>
                        <div class="col-sm-9">
                            @Html.DropDownListFor(m => m.WatermarkTextFont, Sundry.App_Start.Common.SelectItemHelper.FontList(Model.WatermarkTextFont), new { @class = "col-xs-12 col-sm-6" })
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">上传图片水印文字字体大小:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.WatermarkTextSize, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.WatermarkTextSize)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">商品品牌缩略图大小:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.BrandThumbSize, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="格式为‘ 宽_高’,如果有多个用’,‘分割">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.BrandThumbSize)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">商品分类缩略图大小:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.CategoryThumbSize, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="格式为‘ 宽_高’,如果有多个用’,‘分割">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.CategoryThumbSize)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">商品缩略图大小:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.ProductShowThumbSize, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="格式为‘ 宽_高’,如果有多个用’,‘分割">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.ProductShowThumbSize)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">头像缩略图大小:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.UserAvatarThumbSize, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="格式为‘ 宽_高’,如果有多个用’,‘分割">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.UserAvatarThumbSize)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1">店铺Logo缩略图大小:</label>
                        <div class="col-sm-9">
                            @Html.TextBoxFor(m => m.StoreLogoThumbSize, new { @class = "col-xs-12 col-sm-6" })
                            <span class="help-button" data-rel="popover" data-trigger="hover" data-placement="bottom" data-content="格式为‘ 宽_高’,如果有多个用’,‘分割">?</span>
                            <span class="help-inline has-error">
                                <span class=" help-block col-xs-12 col-sm-reset inline">
                                    @Html.ValidationMessageFor(m => m.StoreLogoThumbSize)
                                </span>
                            </span>
                        </div>
                    </div>
                    <div class="space-4"></div>

                    <div class="clearfix form-actions">
                        <div class="col-md-offset-3 col-md-9">
                            <button class="btn btn-info" type="submit">
                                <i class="icon-ok bigger-110"></i>
                                保存
                            </button>

                            @*&nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    返回
                                </button>*@
                        </div>
                    </div>
                }
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>
    <!-- /.page-content -->
</div>

@section Script{
    @RenderPage("~/Areas/Admin/Views/Shared/_UploadImage.cshtml", new { Uid = Sundry.App_Start.Common.UserCookie.GetAdminId(), Operation = "uploadImage", Module = "WatermarkImg", Uploadify = "ImgUp", UploadImageUrl = "UploadImageUrl", ShowImage = "WatermarkImg" })
    <script type="text/javascript">
        $('[data-rel=tooltip]').tooltip({ container: 'body' });
        $('[data-rel=popover]').popover({ container: 'body' });
    </script>
}
